<?php

namespace App\Jobs;


use App\Models\HongBao\HongBao;

class AddRegisterHongBaoJob extends Job
{


    private $user_id;


    public function __construct($user_id)
    {
        $this->user_id = $user_id;
    }

    /**
     * Execute the job.
     *
     * @param HongBao $hongBao
     * @return bool
     * @throws \Exception
     */
    public function handle(HongBao $hongBao)
    {
        $code = $hongBao->addConfigHongBao('register_hong_bao_template',
            $this->user_id,
            'register'
        );
        if($code != 200){
            throw new \Exception('add reg hong bao Fail');
        }
    }
}
